/*jslint browser: true, devel: true, bitwise: true, white: true, plusplus: true */
/*global $:true, define:true */

/**
 * @module UI
 */

define(['WID/UI/Widget'],function(Widget) {
"use strict";

/** 
 * @class Label
 * @constructor
 * @param {Object} props Parameters. See also in {{#crossLink "Widget"}}{{/crossLink}}
 *  @param {String} [props.text] Text for label.
 *  @param {Widget} [props.forWidget] For this label widget with defined id.
 */
function Label(props) {
	props = props||{};
	Widget.call(this,props,'label');
	
	this.forWidget = props.forWidget;
	this.text = props.text||'';
} var extend = Object.create(Widget.prototype); extend.constructor = Label;

Widget.defineProps(extend,{
	text: {
		get: function() {
			return this.ntv.innerText;
		},
		set: function(text) {
			this.ntv.innerText = text;
		}
	},
	
	forWidget: {
		set: function(widget) {
			this.ntv.setAttribute('for',(widget)?widget.id:'');
		}
	}
});

Label.prototype = extend;
return Label;
});
